// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()
const db = cloud.database();

// 云函数入口函数
exports.main = async (event, context) => {
    try{
        console.log("云函数传入的参数：",event);
        return await db.collection("userData").doc(event._id).update({
            data:{
              isHave: true
              // username:event.username,
              // id: event.id,
              // checked: event.checked,
              // day_num: event.day_num,
              // all_num: event.all_num,
              // word_record: event.word_record,
              // now_num: event.now_num,
            }
        })
    }catch(e){
        console.error(e)
    }
}
